import {Component} from 'react';
import {HashRouter as Router,Switch,Route} from 'react-router-dom';
import {combineReducers,createStore,applyMiddleware} from 'redux';
import {Provider,connect} from 'react-redux';
import {action} from './model';
import thunk from 'redux-thunk';
import reducers from './reducers';

import Page from '@/pages/index.jsx';

const todos=combineReducers(reducers.assemble);
const store=createStore(todos,applyMiddleware(thunk));
class App extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <Router >
                <Switch>
                    <Route exact  path="/"  component={Page}/>
                    <Route key="page"   path="/page"  component={Page}/>
                </Switch>
            </Router>
        );
    }

}
const Apps=connect(null,action)(App);
export default <Provider store={store}><Apps /></Provider>;